#ifndef __FACTORY_H__
#define __FACTORY_H__

#include "operation.h"

class IFactory
{
public:
    virtual Operation *CreateOperation() = 0;
};

class AddFactory: public IFactory
{
public:
    Operation *CreateOperation() override
    {
        return new OperationAdd();
    }
};

class SubFactory: public IFactory
{
public:
    Operation *CreateOperation() override
    {
        return new OperationSub();
    }
};

class MulFactory: public IFactory
{
public:
    Operation *CreateOperation() override
    {
        return new OperationMul();
    }
};

class DivFactory: public IFactory
{
public:
    Operation *CreateOperation() override
    {
        return new OperationDiv();
    }
};

#endif